package com.demo.dto;

import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.springframework.lang.NonNull;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

@SuppressWarnings("unused")
@ToString
public class NotifyDTO {

    //分组校验
    public interface add {
    }

    public interface edit {
    }

    /**
     * koubei_trade_itemorder_buy_response : {"code":"10000","msg":"Success","order_no":"20171114111040030100030100002400","trade_no":"2017122021001004560209558948","cashier_order_id":"201801171429447e00b7d293cd5ddErFwj0000053960"}
     * sign : ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE
     */
    // 嵌套校验，校验对象参数的内部属性，需要加@Valid或@Validation在对象属性上
    @Valid
    private KoubeiTradeItemorderBuyResponseBean koubeiTradeItemorderBuyResponseBean;
    @NotNull
    @Length(max = 10, groups = NotifyDTO.add.class)
    private String sign;
    @NotNull(groups = NotifyDTO.add.class)
    private String phone;

    public KoubeiTradeItemorderBuyResponseBean getKoubeiTradeItemorderBuyResponseBean() {
        return koubeiTradeItemorderBuyResponseBean;
    }

    public void setKoubeiTradeItemorderBuyResponseBean(KoubeiTradeItemorderBuyResponseBean koubeiTradeItemorderBuyResponseBean) {
        this.koubeiTradeItemorderBuyResponseBean = koubeiTradeItemorderBuyResponseBean;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public static class KoubeiTradeItemorderBuyResponseBean {
        /**
         * code : 10000
         * msg : Success
         * order_no : 20171114111040030100030100002400
         * trade_no : 2017122021001004560209558948
         * cashier_order_id : 201801171429447e00b7d293cd5ddErFwj0000053960
         */

        @NotNull    //对应值不能为空
        private String code;
        private String msg;
        private String order_no;
        private String trade_no;
        private String cashier_order_id;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public String getOrder_no() {
            return order_no;
        }

        public void setOrder_no(String order_no) {
            this.order_no = order_no;
        }

        public String getTrade_no() {
            return trade_no;
        }

        public void setTrade_no(String trade_no) {
            this.trade_no = trade_no;
        }

        public String getCashier_order_id() {
            return cashier_order_id;
        }

        public void setCashier_order_id(String cashier_order_id) {
            this.cashier_order_id = cashier_order_id;
        }
    }
}
